home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
p_man
/
cat3c
/
mbchar.z
/
mbchar
Wrap
Text File
|
1998-10-20
|
7KB
|
133 lines
mmmmbbbbcccchhhhaaaarrrr((((3333CCCC)))) mmmmbbbbcccchhhhaaaarrrr((((3333CCCC))))
NNNNAAAAMMMMEEEE
_mmmm_bbbb_cccc_hhhh_aaaa_rrrr: _mmmm_bbbb_tttt_oooo_wwww_cccc, _mmmm_bbbb_llll_eeee_nnnn, _wwww_cccc_tttt_oooo_mmmm_bbbb - multibyte character handling
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
_####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_tttt_dddd_llll_iiii_bbbb_...._hhhh_>>>>
_iiii_nnnn_tttt _mmmm_bbbb_tttt_oooo_wwww_cccc _((((_wwww_cccc_hhhh_aaaa_rrrr______tttt _****_pppp_wwww_cccc_,,,, _cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_ssss_,,,, _ssss_iiii_zzzz_eeee______tttt _nnnn_))))_;;;;
_iiii_nnnn_tttt _mmmm_bbbb_llll_eeee_nnnn _((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_ssss_,,,, _ssss_iiii_zzzz_eeee______tttt _nnnn_))))_;;;;
_iiii_nnnn_tttt _wwww_cccc_tttt_oooo_mmmm_bbbb _((((_cccc_hhhh_aaaa_rrrr _****_ssss_,,,, _wwww_cccc_hhhh_aaaa_rrrr______tttt _wwww_cccc_hhhh_aaaa_rrrr_))))_;;;;
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
Multibyte characters are used to represent characters in an extended
character set. This is needed for locales where 8 bits are not enough to
represent all the characters in the character set.
The multibyte character handling functions provide the means of
translating multibyte characters into wide characters and back again.
Wide characters have type _wwww_cccc_hhhh_aaaa_rrrr______tttt (defined in _ssss_tttt_dddd_llll_iiii_bbbb_...._hhhh), which is an
integral type whose range of values can represent distinct codes for all
members of the largest extended character set specified among the
supported locales.
A maximum of 3 extended character sets are supported for each locale.
The number of bytes in an extended character set is defined by the
_LLLL_CCCC______CCCC_TTTT_YYYY_PPPP_EEEE category of the locale [see _ssss_eeee_tttt_llll_oooo_cccc_aaaa_llll_eeee(3C)]. However, the
maximum number of bytes in any multibyte character will never be greater
than _MMMM_BBBB______LLLL_EEEE_NNNN______MMMM_AAAA_XXXX. which is defined in _llll_iiii_mmmm_iiii_tttt_ssss_...._hhhh. The maximum number of
bytes in a character in an extended character set in the _cccc_uuuu_rrrr_rrrr_eeee_nnnn_tttt locale
is given by the macro, _MMMM_BBBB______CCCC_UUUU_RRRR______MMMM_AAAA_XXXX, also defined in _ssss_tttt_dddd_llll_iiii_bbbb_...._hhhh.
_mmmm_bbbb_tttt_oooo_wwww_cccc determines the number of bytes that comprise the multibyte
character pointed to by _s. Also, if _p_w_c is not a null pointer, _mmmm_bbbb_tttt_oooo_wwww_cccc
converts the multibyte character to a wide character and places the
result in the object pointed to by _p_w_c. (The value of the wide character
corresponding to the null character is zero.) At most _n characters will
be examined, starting at the character pointed to by _s.
If _s is a null pointer, _mmmm_bbbb_tttt_oooo_wwww_cccc simply returns 0. If _s is not a null
pointer, then, if _s points to the null character, _mmmm_bbbb_tttt_oooo_wwww_cccc returns 0; if
the next _n or fewer bytes form a valid multibyte character, _mmmm_bbbb_tttt_oooo_wwww_cccc
returns the number of bytes that comprise the converted multibyte
character; otherwise, _s does not point to a valid multibyte character and
_mmmm_bbbb_tttt_oooo_wwww_cccc returns -1.
_mmmm_bbbb_llll_eeee_nnnn determines the number of bytes comprising the multibyte character
pointed to by _s. It is equivalent to
mbtowc ((wchar_t *)0, s, n);
PPPPaaaaggggeeee 1111
mmmmbbbbcccchhhhaaaarrrr((((3333CCCC)))) mmmmbbbbcccchhhhaaaarrrr((((3333CCCC))))
_wwww_cccc_tttt_oooo_mmmm_bbbb determines the number of bytes needed to represent the multibyte
character corresponding to the code whose value is _w_c_h_a_r, and, if _s is
not a null pointer, stores the multibyte character representation in the
array pointed to by _s. At most _MMMM_BBBB______CCCC_UUUU_RRRR______MMMM_AAAA_XXXX characters are stored.
If _s is a null pointer, _wwww_cccc_tttt_oooo_mmmm_bbbb simply returns 0. If _s is not a null
pointer, _wwww_cccc_tttt_oooo_mmmm_bbbb returns -1 if the value of _w_c_h_a_r does not correspond to a
valid multibyte character; otherwise it returns the number of bytes that
comprise the multibyte character corresponding to the value of _w_c_h_a_r.
SSSSEEEEEEEE AAAALLLLSSSSOOOO
_wwww_cccc_hhhh_rrrr_tttt_bbbb_llll(1M), _mmmm_bbbb_ssss_tttt_rrrr_iiii_nnnn_gggg(3C), _ssss_eeee_tttt_llll_oooo_cccc_aaaa_llll_eeee(3C), _eeee_nnnn_vvvv_iiii_rrrr_oooo_nnnn(5).
PPPPaaaaggggeeee 2222